<template>
	<view>
		<image class="topImg"
			src="https://store-profit-system.oss-cn-shanghai.aliyuncs.com/uniappImg/businessBanner.png" mode=""></image>
		<form @submit="formSubmit" report-submit='true'>
			<view class='addAddress pad30'>
				<view class='list borRadius14'>
					<!-- <view class='item acea-row row-between-wrapper' style="border: none;">
						<view class='name'>商户名称</view>
						<input type='text' placeholder='请填写商户名称' placeholder-style="color:#ccc;" name='realName'
							v-model="userAddress.realName" placeholder-class='placeholder' maxlength="4"></input>
					</view> -->
					<view class='item acea-row row-between-wrapper'>
						<view class='name'>用户姓名</view>
						<input type='text' placeholder='请填写姓名' placeholder-style="color:#ccc;" name="name"
							v-model="userAddress.name" placeholder-class='placeholder' maxlength="11"></input>
					</view>
				<!-- 	<view class='item acea-row row-between-wrapper relative'>
						<view class='name'>联系电话</view>
						<input type='text' placeholder='请填写手机号' placeholder-style="color:#ccc;" name='phone'
							v-model='userAddress.phone' placeholder-class='placeholder' maxlength="18"></input>
					</view> -->
				</view>
				<view class='list borRadius14' style="height: 439rpx;margin-top: 30rpx;">
					<view class='item acea-row row-between-wrapper' style="border: none;">
						<view class='name'>申请说明</view>
					</view>
					<textarea class="content" placeholder="请输入申请说明…" v-model="userAddress.desc" />
				</view>
			</view>
			<view class='footer acea-row row-between-wrapper'>
				<view class='addressBnt' form-type="submit" @click="submit">提交</view>
			</view>
		</form>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				userAddress: {
					realName: '',
					name: '',
					// phone: '',
					desc: ''
				}
			}
		},
		methods: {
			submit() {
				// 验证表单数据
				// if (!this.userAddress.realName) {
				// 	uni.showToast({
				// 		title: '请填写商户名称',
				// 		icon: 'none',
				// 		duration: 2000
				// 	});
				// 	return;
				// }
				if (!this.userAddress.name) {
					uni.showToast({
						title: '请填写用户姓名',
						icon: 'none',
						duration: 2000
					});
					return;
				}
				// if (!this.userAddress.phone) {
				// 	uni.showToast({
				// 		title: '请填写联系电话',
				// 		icon: 'none',
				// 		duration: 2000
				// 	});
				// 	return;
				// }
				if (!this.userAddress.desc) {
					uni.showToast({
						title: '请填写申请说明',
						icon: 'none',
						duration: 2000
					});
					return;
				}

				// 表单数据验证通过，进行提交操作
				console.log("提交");
				console.log(this.userAddress);
				uni.showToast({
					title: '提交成功',
					icon: 'success',
					duration: 2000
				});
			},
			uploadpic: function(type) {
				let that = this;
				that.$util.uploadImageOne({
					url: 'user/upload/image',
					name: 'multipart',
					model: "user",
					pid: 1
				}, function(res) {
					if (type === 'W') {
						that.qrcodeUrlW = res.data.url;
					} else {
						that.qrcodeUrlZ = res.data.url;
					}
				});
			},
			/**
			 * 删除图片
			 * 
			 */
			DelPicW: function() {
				this.qrcodeUrlW = "";
			},
			DelPicZ: function() {
				this.qrcodeUrlZ = "";
			},
		}
	}
</script>
<style scoped lang="scss">
	.upImgBox {
		padding-top: 20rpx;

		.name {
			font-weight: 400;
			font-size: 30rpx;
			color: #1A1A1A;
			line-height: 32rpx;
			text-align: left;
		}

		.tishi {
			font-weight: 400;
			font-size: 22rpx;
			color: #CECECE;
			line-height: 32rpx;
			text-align: left;
			margin: 20rpx 0rpx;
		}

		.input {
			width: 136rpx;
			height: 136rpx;
			font-size: 24rpx;
			text-align: center;
			border: 2px dashed #CECECE;
			/* 默认虚线边框 */
			padding-top: 20rpx;
		}
	}

	.topImg {
		width: 100%;
		height: 241rpx;
	}

	.addAddress {
		padding-top: 20rpx;
	}

	.addAddress .list {
		background-color: #fff;
		padding: 0 24rpx;
	}

	.addAddress .list .item {
		border-top: 1rpx solid #eee;
		height: 90rpx;
		line-height: 90rpx;
	}

	.addAddress .list .item .name {
		// width: 195rpx;
		font-size: 30rpx;
		color: #333;
	}

	.addAddress .list .item .address {
		flex: 1;
		margin-left: 50rpx;
	}

	.addAddress .list .item input {
		width: 475rpx;
		font-size: 30rpx;
		font-weight: 400;
	}

	.addAddress .list .item .placeholder {
		color: #ccc;
	}

	.addAddress .list .item picker .picker {
		width: 410rpx;
		font-size: 30rpx;
	}

	.addAddress .default {
		padding: 0 30rpx;
		height: 90rpx;
		background-color: #fff;
		margin-top: 23rpx;
	}

	.addAddress .default checkbox {
		margin-right: 15rpx;
	}

	.addAddress .keepBnt {
		width: 690rpx;
		height: 86rpx;
		border-radius: 50rpx;
		text-align: center;
		line-height: 86rpx;
		margin: 80rpx auto 24rpx auto;
		font-size: 32rpx;
		color: #fff;
	}

	.addAddress .wechatAddress {
		width: 690rpx;
		height: 86rpx;
		border-radius: 50rpx;
		text-align: center;
		line-height: 86rpx;
		margin: 0 auto;
		font-size: 32rpx;
		color: #E93323;
		border: 1px solid #E93323;
	}

	.relative {
		position: relative;
	}

	.icon-dizhi {
		font-size: 44rpx;
		z-index: 100;
	}

	.abs_right {
		position: absolute;
		right: 0;
	}

	.status {
		display: flex;
		width: 750rpx;
		// background-color: #E93323;
		height: var(--status-bar-height);
	}

	.footer {
		position: fixed;
		width: 100%;
		background-color: #fff;
		bottom: 0;
		height: 106rpx;
		padding: 0 30rpx;
		box-sizing: border-box;
	}

	.footer .addressBnt {
		// width: 330rpx;
		// height: 76rpx;
		// border-radius: 50rpx;
		text-align: center;
		line-height: 86rpx;
		font-size: 30rpx;
		color: #fff;

		width: 702rpx;
		height: 84rpx;
		background: #085CD6;
		border-radius: 84rpx;
	}

	.footer .addressBnt.on {
		width: 690rpx;
		margin: 0 auto;
	}

	.footer .addressBnt .iconfont {
		font-size: 35rpx;
		margin-right: 8rpx;
		vertical-align: -1rpx;
	}

	.footer .addressBnt.wxbnt {
		background-color: #fe960f;
	}

	.cash-withdrawal .wrapper .list .item .picEwm,
	.cash-withdrawal .wrapper .list .item .pictrue {
		width: 140rpx;
		height: 140rpx;
		border-radius: 3rpx;
		position: relative;
		margin-right: 23rpx;
	}

	.cash-withdrawal .wrapper .list .item .picEwm image {
		width: 100%;
		height: 100%;
		border-radius: 3rpx;
	}

	.cash-withdrawal .wrapper .list .item .picEwm .icon-guanbi1 {
		position: absolute;
		right: -14rpx;
		top: -16rpx;
		font-size: 40rpx;
	}

	.cash-withdrawal .wrapper .list .item .pictrue {
		border: 1px solid rgba(221, 221, 221, 1);
		font-size: 22rpx;
		color: #BBBBBB;
	}

	.cash-withdrawal .wrapper .list .item .pictrue .icon-icon25201 {
		font-size: 47rpx;
		color: #DDDDDD;
		margin-bottom: 3px;
	}
</style>